﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title></title>
<script type="text/javascript" src="../../../_data/SysConfig.js"></script>
<script type="text/javascript" src="../../../_libs/jquery-min.js"></script>
<script type="text/javascript" src="../../../_libs/jquery.jtemplates.js"></script>
<script type="text/javascript" src="../../../scripts/jumbotcms.js?v4"></script>
<link type="text/css" rel="stylesheet" href="../../../style/global.css" />
<script type="text/javascript" src="../../../admin/otherpage/styles/common.js"></script>
<link type="text/css" rel="stylesheet" href="../../../admin/otherpage/styles/common.css" /><script type="text/javascript">
var mtype = q('ctype');//模块类型
var ctype = joinValue('ctype');//频道类型
var ccid = joinValue('ccid');//频道ID
var cid = joinValue('cid');//栏目ID
var k=joinValue('k');//关键字
var f=joinValue('f');//检索字段
var s=joinValue('s');//检索状态
var d=joinValue('d');//检索时间
var pagesize=15;
var page=thispage();
$(document).ready(function(){
	ajaxTopNav();
	ajaxList(page);
});
function ajaxList(currentpage)
{
	if(currentpage!=null) page=currentpage;
	$.ajax({
		type:		"get",
		dataType:	"json",
		data:		"page="+currentpage+"&pagesize="+pagesize+"&time="+(new Date().getTime()),
		url:		"ajax.aspx?oper=ajaxGetList"+ccid+cid+k+f+s+d,
		error:		function(XmlHttpRequest,textStatus, errorThrown) { alert(XmlHttpRequest.responseText);},
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				top.JumbotCms.Alert(d.returnval, "0", "top.window.location='" + site.Dir + "admin/login.htm';");
				break;
			case '0':
				top.JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				$("#ajaxList").setTemplateElement("tplList", null, {filter_data: true});
				$("#ajaxList").processTemplate(d);
				$("#ajaxPageBar").html(d.pagerbar);
				ActiveCoolTable();
				break;
			}
		}
	});
}
function operater(act,classid){
	var ids = JoinSelect("selectID");
	if(ids=="")
	{
		top.JumbotCms.Alert("没有任何选择项", "0"); 
		return;
	}
	top.JumbotCms.Loading.show("正在处理...");
	$.ajax({
		type:		"post",
		dataType:	"json",
		data:		"ids="+ids+"&tocid="+classid,
		url:		"ajax.aspx?oper=ajaxBatchOper&act="+act+"&time="+(new Date().getTime()) + ccid,
		error:		function(XmlHttpRequest,textStatus, errorThrown){top.JumbotCms.Loading.hide();alert(XmlHttpRequest.responseText); },
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				top.JumbotCms.Alert(d.returnval, "0", "top.window.location='" + site.Dir + "admin/login.htm';");
				break;
			case '0':
				top.JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				top.JumbotCms.Loading.hide();
				ajaxList(page);
				break;
			}
		}
	});
}
function ConfirmDel(id){
	top.JumbotCms.Confirm("确定要删除吗?", "IframeOper.ajaxDel("+id+")");
}
function ajaxDel(id){
	$.ajax({
		type:		"post",
		dataType:	"json",
		data:		"id="+id,
		url:		"ajax.aspx?oper=ajaxDel&time="+(new Date().getTime()) + ccid,
		error:		function(XmlHttpRequest,textStatus, errorThrown){top.JumbotCms.Loading.hide();alert(XmlHttpRequest.responseText); },
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				top.JumbotCms.Alert(d.returnval, "0", "top.window.location='" + site.Dir + "admin/login.htm';");
				break;
			case '0':
				top.JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				ajaxList(page);
				break;
			}
		}
	});
}
function ajaxTopNav()
{
	$.ajax({
		type:		"get",
		dataType:	"html",
		data:		"time="+(new Date().getTime()) + ccid,
		url:		site.Dir + "admin/class/moveclassbar.aspx",
		error:		function(XmlHttpRequest,textStatus, errorThrown) { alert(XmlHttpRequest.responseText);},
		success:	function(d){
			$("#ajaxTopNav").setTemplateElement("tplTopNav", null, {filter_data: false});
			$("#ajaxTopNav").processTemplate(d);
		}
	});
}
function move2class(classid){
	operater("move2class",classid);
}
var PublicID="";
function move2special(){
	PublicID = JoinSelect("selectID");
	if(PublicID=="")
	{
		top.JumbotCms.Alert("没有任何选择项", "0"); 
		return;
	}
	top.JumbotCms.Popup.show(site.Dir + 'admin/special/list2.htm',520,-1,false);
}
function ajaxMove2Special(specialid)
{
	top.JumbotCms.Popup.hide();
	top.JumbotCms.Loading.show("正在处理...");
	$.ajax({
		type:		"post",
		dataType:	"json",
		data:		"ids="+PublicID+"&tosid="+specialid,
		url:		site.Dir + "admin/content/ajax.aspx?oper=ajaxMove2Special&time="+(new Date().getTime()) + ccid,
		error:		function(XmlHttpRequest,textStatus, errorThrown){top.JumbotCms.Loading.hide();alert(XmlHttpRequest.responseText); },
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				top.JumbotCms.Alert(d.returnval, "0", "top.window.location='" + site.Dir + "admin/login.htm';");
				break;
			case '0':
				top.JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				top.JumbotCms.Loading.hide();
				ajaxList(page);
				break;
			}
		}
	});
}
function ajaxSearch(){
	top.JumbotCms.Popup.show(site.Dir + "admin/content/searchform.aspx?ctype="+mtype+ccid+cid+k+f+s+d,500,280,false);
}
    </script>
</head>
<body>
<textarea id="tplTopNav" style="display:none"><div class="topnav"> <span class="preload1"></span><span class="preload2"></span>
	<ul id="topnavbar">
		<li class="topmenu"><a href="javascript:void(0);" class="top_link"><span
            class="down">批量操作</span></a>
			<ul class="sub">
				<li><a href="javascript:void(0);" onclick="operater('createhtml')">静态生成</a></li>
				<li><a href="javascript:void(0);" onclick="operater('pass')">审核内容</a></li>
				<li><a href="javascript:void(0);" onclick="operater('nopass')">取消审核</a></li>
				<li><a href="javascript:void(0);" onclick="operater('top')">推荐内容</a></li>
				<li><a href="javascript:void(0);" onclick="operater('notop')">取消推荐</a></li>
				<li><a href="javascript:void(0);" onclick="operater('sdel')">放入回收站</a></li>
				<li><a href="javascript:void(0);" onclick="operater('del')">直接删除</a></li>
			</ul>
		</li>
		<li class="topmenu"><a href="javascript:void(0);" class="top_link"><span class="down">移动至栏目</span></a>
			{$T}
		</li>
		<li class="topmenu"><a href="javascript:void(0);" onclick="move2special()" class="top_link"><span>加入专题</span></a></li>
		<li class="topmenu"><a href="javascript:void(0);" onclick="ajaxSearch();" class="top_link"><span>过滤检索</span></a></li>
		<li class="topmenu"><a href="javascript:void(0);" onclick="top.JumbotCms.Popup.show(site.Dir + 'admin/class/list.htm?id=0'+ccid,-1,-1,true)" class="top_link"><span>栏目管理</span></a></li>
		<li class="topmenu"><a href="javascript:void(0);" onclick="top.JumbotCms.Popup.show(site.Dir + 'modules/'+mtype+'/admin/edit.aspx?id=0'+ccid,-1,-1,true)" class="top_link"><span>添加内容</span></a></li>
		<li class="topmenu" id="li_createhtml"><a href="javascript:void(0);" onclick="top.JumbotCms.Popup.show(site.Dir + 'admin/createhtml/index.aspx?id=0'+ccid,-1,-1,true)" class="top_link"><span>前台更新</span></a></li>
	</ul>
	<script>
	topnavbarStuHover();
    </script>
</div></textarea>
<div id="ajaxTopNav"></div>
<textarea id="tplList" style="display:none">
<table class="cooltable">
<thead>
	<tr>
		<th align="center" scope="col" style="width:30px;"><input onclick="checkAllLine()" id="checkedAll" name="checkedAll" type="checkbox" /></th>
		<th scope="col" style="width:60px;">ID</th>
		<th scope="col" width="*">标题</th>
		<th scope="col" style="width:120px;">所属栏目</th>
		<th scope="col" style="width:50px;">状态</th>
		<th scope="col" style="width:70px;">操作</th>
	</tr>
</thead>
<tbody>
	{#foreach $T.table as record}
	<tr>
		<td align="center"><input class="checkbox" name="selectID" type="checkbox" value='{$T.record.id}' />
		</td>
		<td align="center">{$T.record.id}</td>
		<td align="left">&nbsp;
			{#if $T.record.outurl != ""}
			<a href="{$T.record.outurl}" target="_blank">{$T.record.title}</a>
			{#else}
			<a href="{site.Dir}controls/document.aspx?ChannelId={$T.record.channelid}&id={$T.record.id}&preview=1" target="_blank">{$T.record.title}</a>
			{#/if}
		</td>
		<td align="left"><a>{$T.record.classname}</a></td>
		<td align="center">
			{#if $T.record.ispass == "1"}
			已审
			{#/if}
			{#if $T.record.ispass == "0"}
			<font color='blue'>未审</font>
			{#/if}
			{#if $T.record.ispass == "-1"}
			<font color='red'>已删</font>
			{#/if}
		</td>
		<td align="center" class="oper">
			<a href="javascript:void(0);" onclick="top.JumbotCms.Popup.show(site.Dir + 'modules/'+mtype+'/admin/edit.aspx?id={$T.record.id}'+ ccid,-1,-1,true)">修改</a>
			<a href="javascript:void(0);" onclick="ConfirmDel({$T.record.id})">删除</a>
		</td>
	</tr>
	{#/for}
</tbody>
</table></textarea>
<div id="ajaxList"> </div>
<div id="ajaxPageBar" class="pages"> </div>
</body>
</html>
